package com.crm.common.ka.core.exception;


import com.crm.common.ka.core.common.ResultCode;
import com.crm.common.ka.core.common.SystemCodeEnum;
import com.crm.common.ka.core.entity.UserExtraInfo;

/**
 * 用户尚未登陆
 */
public class NoLoginException extends RuntimeException implements ResultCode {

    private UserExtraInfo info;

    public NoLoginException() {
        this(null);
    }

    public NoLoginException(UserExtraInfo info) {
        super("请先登录！", null, false, false);

        this.info = info;
    }

    public UserExtraInfo getInfo() {
        return info;
    }

    @Override
    public int getCode() {
        return SystemCodeEnum.SYSTEM_NOT_LOGIN.getCode();
    }

    @Override
    public String getMsg() {
        return SystemCodeEnum.SYSTEM_NOT_LOGIN.getMsg();
    }
}
